package com.ccsoft.atools.service;

import com.ccsoft.atools.dao.SysObjectMapper;
import com.ccsoft.atools.model.SysObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysObjectServiceImpl implements SysObjectService {

    @Autowired
    private SysObjectMapper dao;

    @Override
    public int deleteByPrimaryKey(Integer iid) {
        return dao.deleteByPrimaryKey(iid);
    }

    @Override
    public SysObject insert(SysObject record) {
        int ret = dao.insert(record);
        return selectByPrimaryKey(record.getIid());
    }

    @Override
    public SysObject insertSelective(SysObject record) {
        int ret = dao.insertSelective(record);
        return selectByPrimaryKey(record.getIid());
    }

    @Override
    public SysObject selectByPrimaryKey(Integer iid) {
        return dao.selectByPrimaryKey(iid);
    }

    @Override
    public SysObject updateByPrimaryKeySelective(SysObject record) {
        int ret = dao.updateByPrimaryKeySelective(record);
        return selectByPrimaryKey(record.getIid());
    }

    @Override
    public SysObject updateByPrimaryKey(SysObject record) {
        int ret = dao.updateByPrimaryKey(record);
        return selectByPrimaryKey(record.getIid());
    }

    @Override
    public List<SysObject> selectByModule(String moduleSid) {
        return dao.selectByModule(moduleSid);
    }

    @Override
    public List<SysObject> selectAll() {
        return dao.selectAll();
    }
}
